<?php
/* @package     Joomla.Site
 * @subpackage  Layout
 * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt*/
defined('_JEXEC') or die;?>
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery("#mod_pukkaBanners .accordion-content").hide();
	jQuery("#mod_pukkaBanners .selected .accordion-content").show();
	jQuery("#mod_pukkaBanners .itemPreviewTitle").click(function(){
		if(jQuery(this).parent().hasClass("selected")){
		jQuery(this).nextAll(".accordion-content").slideUp().parent().removeClass("selected");
		}else{
		jQuery("#mod_pukkaBanners .accordion-content").slideUp().parent().removeClass("selected");
		jQuery(this).nextAll(".accordion-content").slideDown().parent().addClass("selected");}
	});
});
</script>
<?php
$params = $this->item->params;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$canEdit = $this->item->params->get('access-edit');
JHtml::_('behavior.framework');
	$db = & JFactory::getDBO();
	$queryfaqlists = "SELECT * FROM #__content WHERE catid='15' and state=1";					
	$db->setQuery($queryfaqlists);
	$faqlists = $db->loadObjectList();
?>
<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
	|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != '0000-00-00 00:00:00' )) : ?>
	<div class="system-unpublished">
<?php endif; ?>

<div id="mod_pukkaBanners" class="moduleOutput viewList">
	<div class="moduleBody">
		<?php /*?><div class="itemPreview selected">
			<h3 class="itemPreviewTitle accordion-header"><?php echo $faqlists[0]->title;?></h3>
			<div style="display: block;" class="accordion-content">					
				<div class="description_content contentarticle">
                	<div class="tagsarticle"><?php echo $faqlists[0]->metakey;?></div>
					<?php echo $faqlists[0]->introtext; ?>
				</div>
			</div>
		</div><?php */?>
        <?php
        for($i=0;$i<count($faqlists);$i++){
		?>
		<div class="itemPreview">
			<h3 class="itemPreviewTitle accordion-header"><?php echo $faqlists[$i]->title;?></h3>
			<div style="display: none;" class="accordion-content">					
				<div class="description_content contentarticle">
					<div class="tagsarticle"><?php echo $faqlists[$i]->metakey;?></div>
					<?php echo $faqlists[$i]->introtext; ?>
				</div>
			</div>
		</div>
        <?php
		}
		?>
	</div>
</div>

<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
	|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != '0000-00-00 00:00:00' )) : ?>
</div>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>